Repository navigation
Fixes #38303: preserve BSON string column types in MongoDB/NoSQL ingestion - #38316
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
… View - Fix ruff format (py-checkstyle failure) - Use "True"/"False" so the boolean case exercises the fix - Move test to tests/unit/topology/database; drop redundant datalake test - Add type hints to NoSQLDataFrameColumnParser.fetch_col_types - Report MongoDB views as TableType.View via query_view_names_and_types - Mongo integration test: numeric-looking string field and view type
- Replace the f-string debug log with %-style args (G004 check) - Prune the obsolete G004 baseline entry for the removed log line
Code Review ✅ Approved 🟡 Medium riskPreserving native NoSQL strings and classifying MongoDB views changes ingested metadata, so incorrect sampling or listing could misstate column and table types. Preserves BSON string column types during MongoDB/NoSQL metadata ingestion by adding a NoSQL-specific column parser that keeps all-string columns as VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Problem
MongoDB view field
CODIGOholds the BSON string"01051", but OpenMetadata 2.0.5 registers it asINT. The reporter verified 8,137 BSON string records. Numeric-looking codes lose their semantic leading-zero type in metadata, even though sample data still shows the original string.The generic dataframe parser intentionally calls
ast.literal_eval(str(value))to infer types from CSV/datalake text.CommonNoSQLSourcereused it for already-typed BSON values, so string values were incorrectly interpreted as integers or dates.Fix
NoSQLDataFrameColumnParser, a small specialization used only byCommonNoSQLSource.DataType.STRINGinstead of inferring the type again from the string contents.Fixes #38303. Related investigation: #32075.
Tests
Added
test_common_nosql_native_string_types.pycovering:The repository regression file
test_common_nosql_native_string_types.pypassed (4/4) using the source tree from84ba1ec. The original MongoDB view integration scenario and upstream CI still await verification.Prepared with AI assistance.


Confidence Score: 5/5
The PR appears safe to merge; no actionable defects were found.Summary
Adds
NoSQLDataFrameColumnParserso sampled NoSQL columns containing only native strings staySTRING.Reviews (7) · Last reviewed commit: "Merge branch 'main' into fix/mongodb-pre..." · Reviewed by Greptile
Summary by Gitar
TableType.Viewviaquery_view_names_and_typestypefilter in_list_collectionstest_views_are_ingested_as_viewsand azip_codestring column fixtureThis will update automatically on new commits.